<?php

namespace Addons\Vote\Model;

use Think\Model;

/**
 * Vote模型
 */
class VoteLogModel extends Model {
	// 获取信息
	function getFollowLog($follow_id, $vote_id, $update = false) {
			$map ['vote_id'] = $vote_id;
			$map ['user_id'] = $follow_id;
            $map ['cTime'] = array('gt',get_today_int_stamp());
			$info = (array)$this->where ( $map )->select ();

		return $info;
	}

    // 当日内用户可以投三次
    function getFollowLog_day_three($follow_id, $vote_id, $update = false) {
            $map ['vote_id'] = $vote_id;
            $map ['user_id'] = $follow_id;
            $map ['cTime'] = array('gt',get_today_int_stamp());
            $info = (array)$this->where ( $map )->select ();
        return $info;
    }




    //日志 ,一个用户在投票中可以选择投票一个商家,1个用户可以投3个商家
    function getFollowLog_three($follow_id, $vote_id,$vote_option,$update = false) {
        $map ['vote_id'] = $vote_id;
        $map ['user_id'] = $follow_id;
        $map ['options'] = $vote_option;
        $map ['cTime'] = array('gt',get_today_int_stamp());
        $info = (array)$this->where ( $map )->select ();
        return $info;
    }
}
